export default class File{
    static convertToBolob = function (data) {
        var info = data.split(',');
        var bytes = window.atob(info[1]);        //去掉url的头，并转换为byte
        var type = info[0].split(';')[0].split(':')[1];
        //处理异常,将ascii码小于0的转换为大于0
        var ab = new ArrayBuffer(bytes.length);
        var ia = new Uint8Array(ab);
        for (var i = 0; i < bytes.length; i++) {
            ia[i] = bytes.charCodeAt(i);
        }

        return new Blob([ab], {type: type});
    }
}
